Graphics processors generate images for display using a graphics pipeline that includes a sequence of programmable shaders and fixed function hardware blocks to render images based on a model of a scene. For example, a 3-D model of an object that is visible in a frame is represented by a set of primitives such as triangles, other polygons, or patches that are processed in a graphics pipeline to produce values of pixels for display to a user. Each primitive is represented by values, such as red-green-blue (RGB) colors, at vertices of the primitive. For example, a triangle is represented by a set of values at the three vertices of the triangle. The graphics pipeline accesses vertices of the triangles using indices that identify the vertices. An index of a vertex is represented by a binary number that typically includes 16 bits or 32 bits. Indices for a set of triangles are processed in “chunks” that include a predetermined number of indices, such as 16 indices per chunk. The chunks are stored in an index buffer prior to being used by the graphics pipeline.
A chunk is either an ordinary chunk or a monotonic chunk. An ordinary chunk sequentially lists the three vertices for each triangle in the chunk. A monotonic chunk takes advantage of the fact that adjacent triangles share two vertices. For example, a tri-strip mesh of triangles includes a large proportion of triangles that are adjacent to each other. The monotonic chunk represents successive adjacent triangles by adding only the index of the vertex that is not shared by the adjacent triangles. The monotonic chunk therefore does not repeat the indices of vertices that are shared by two successive triangles. For example, if the vertices of a first triangle have the indices 8, 9, 10 and the vertices of a second triangle have the indices 9, 10, 11, the representation of the first and second triangles in a monotonic chunk would list the indices 8, 9, 10, and 11. In contrast, an ordinary chunk would represent the first and second triangles as 8, 9, 10, 9, 10, 11. Successively dispatched triangles are not always adjacent and so monotonic chunks include a restart index to indicate that the next index identifies a vertex of a triangle that does not share vertices with the previous triangle in the monotonic chunk.